#include <iostream>
#include <arpa/inet.h>

using namespace std;

int main( int argc, char *argv[] )
{
	long x = 0X12345678;
	long y;
	char *c = (char*)&x;

	cout << "H = " << *c 
		<< ", " << *(c+1) 
		<< ", " << *(c+2)
		<< ", " << *(c+3) 
		<< endl;
	//H = x, V, 4, 


	y = htonl(x);

	c = (char*)&y;

	cout << "H = " << *c 
		<< ", " << *(c+1) 
		<< ", " << *(c+2)
		<< ", " << *(c+3)
		<< endl;
	//H = , 4, V, x

	long z = ntohl( x );

	c = (char*)&y;

	cout << "H = " << *c 
		<< ", " << *(c+1) 
		<< ", " << *(c+2)
		<< ", " << *(c+3)
		<< endl;
	//H = , 4, V, x
	
	return 0;
}


